import request from './request'
import qs from 'qs'
// 配置具体请求
export const getJinPindataApi = () => request.get('/products/recommend')
// 热门兑换
export const getRexiaodataApi = () => request.get('/products/hot')
// 获取验证码
export const getCodedataApi = (phone) => request.post('/sendSMS', qs.stringify(phone))
// 登录 /phoneRegin
export const LogindataApi = (phone) => request.post('/phoneRegin', qs.stringify(phone))

//  获取用户信息 /shop/userProfiles
export const getUresInfoApi = () => request.get('/shop/userProfiles')

// 微信登录（这个接口必须用qs对数据进行格式化）
export const WeixinLoginApi = (params) => request.post(`/wechatUsers/PCLogin`, qs.stringify(params));

// 手机绑定微信 /wechatUsers/binding
export const bindWechatPhoneApi = (params) => request.post('/wechatUsers/binding', qs.stringify(params))


// 手机解绑微信  /wechatUsers/unbindingWeChat
export const UnbindWechatPhoneApi = () => request.put('/wechatUsers/unbindingWeChat')

// 商品页 数据获取 /products
export const GetGoodsDataApi = (params) => request.get('/products', { params })

// 商品详情的接口 /products/{id}
export const GetGoodsDetailApi = (params) => request.get(`/products/${params}`)

// 查看购物车 /shop/carts
export const GetCartDataApi = () => request.get('/shop/carts')

// 删除购物车商品 /shop/carts?productIds={id}
export const DelCartDataApi = (params) => request.delete(`/shop/carts?productIds=${params}`)